function GAD_Etom_cdf_plot_MI_pvalues(Placeness_MetaData)
%% collect data for WT saline
% G18
G18_saline_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F4_18') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G18_saline_MI_pvalues)
        G18_saline_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F4_18') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G18_saline_MI_pvalues)
        G18_saline_MI_pvalues = cat(1,G18_saline_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    end
end
[G18sf,G18sx,G18slow,G18shigh] = ecdf(G18_saline_MI_pvalues,'Function','cdf','Alpha',0.05);

% G28
G28_saline_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_28') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G28_saline_MI_pvalues)
        G28_saline_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_28') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G28_saline_MI_pvalues)
        G28_saline_MI_pvalues = cat(1,G28_saline_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    end
end
[G28sf,G28sx,G28slow,G28shigh] = ecdf(G28_saline_MI_pvalues,'Function','cdf','Alpha',0.05);

% G31
G31_saline_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_31') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G31_saline_MI_pvalues)
        G31_saline_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_31') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G31_saline_MI_pvalues)
        G31_saline_MI_pvalues = cat(1,G31_saline_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    end
end
[G31sf,G31sx,G31slow,G31shigh] = ecdf(G31_saline_MI_pvalues,'Function','cdf','Alpha',0.05);

% G34
G34_saline_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_34') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G34_saline_MI_pvalues)
        G34_saline_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_34') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G34_saline_MI_pvalues)
        G34_saline_MI_pvalues = cat(1,G34_saline_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    end
end
[G34sf,G34sx,G34slow,G34shigh] = ecdf(G34_saline_MI_pvalues,'Function','cdf','Alpha',0.05);

% G42
G42_saline_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F6(2)_42') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G42_saline_MI_pvalues)
        G42_saline_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F6(2)_42') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'day1') && isempty(G42_saline_MI_pvalues)
        G42_saline_MI_pvalues = Placeness_MetaData(n).MI_p_values;        
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F6(2)_42') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G42_saline_MI_pvalues)
        G42_saline_MI_pvalues = cat(1,G42_saline_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F6(2)_42') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'day1') && ~isempty(G42_saline_MI_pvalues)
        G42_saline_MI_pvalues = cat(1,G42_saline_MI_pvalues,Placeness_MetaData(n).MI_p_values);        
    end
end
[G42sf,G42sx,G42slow,G42shigh] = ecdf(G42_saline_MI_pvalues,'Function','cdf','Alpha',0.05);

%% Organize data for WT saline

% get WT saline CDF mean
A = cat(1,G18sf,G28sf,G31sf,G34sf,G42sf);
WT_saline_F = sort(A);

% get WT saline CDF x-steps
B = cat(1,G18sx,G28sx,G31sx,G34sx,G42sx);
WT_saline_X = sort(B);

% get WT saline CDF high bound mean
C = cat(1,G18shigh,G28shigh,G31shigh,G34shigh,G42shigh);
WT_saline_H = sort(C);

% get WT saline CDF low bound mean
D = cat(1,G18slow,G28slow,G31slow,G34slow,G42slow);
WT_saline_L = sort(D);

% Optional plotting
% % figure
% % plot(WT_saline_X, WT_saline_F, '-b', 'LineWidth', 1);
% % hold on
% % plot(WT_saline_X, WT_saline_H, '--k', 'LineWidth', 0.1);
% % hold on
% % plot(WT_saline_X, WT_saline_L, '--k', 'Linewidth', 0.1);
% % xlim([0,1])
% % ylim([0,1])
% % legend('p-WT saline','95% confidence interval','','Location','northwest')
% % hold off

%% collect data for MUT saline
% G17
G17_saline_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F4_17') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G17_saline_MI_pvalues)
        G17_saline_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F4_17') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G17_saline_MI_pvalues)
        G17_saline_MI_pvalues = cat(1,G17_saline_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    end
end
[G17sf,G17sx,G17slow,G17shigh] = ecdf(G17_saline_MI_pvalues,'Function','cdf','Alpha',0.05);

% G21
G21_saline_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_21') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G21_saline_MI_pvalues)
        G21_saline_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_21') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G21_saline_MI_pvalues)
        G21_saline_MI_pvalues = cat(1,G21_saline_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    end
end
[G21sf,G21sx,G21slow,G21shigh] = ecdf(G21_saline_MI_pvalues,'Function','cdf','Alpha',0.05);

% G45
G45_saline_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_45') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G45_saline_MI_pvalues)
        G45_saline_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_45') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G45_saline_MI_pvalues)
        G45_saline_MI_pvalues = cat(1,G45_saline_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    end
end
[G45sf,G45sx,G45slow,G45shigh] = ecdf(G45_saline_MI_pvalues,'Function','cdf','Alpha',0.05);

% G53
G53_saline_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_53') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G53_saline_MI_pvalues)
        G53_saline_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_53') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G53_saline_MI_pvalues)
        G53_saline_MI_pvalues = cat(1,G53_saline_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    end
end
[G53sf,G53sx,G53slow,G53shigh] = ecdf(G53_saline_MI_pvalues,'Function','cdf','Alpha',0.05);

% G36
G36_saline_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F6(2)_36') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G36_saline_MI_pvalues)
        G36_saline_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F6(2)_36') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'day1') && isempty(G36_saline_MI_pvalues)
        G36_saline_MI_pvalues = Placeness_MetaData(n).MI_p_values;        
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F6(2)_36') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G36_saline_MI_pvalues)
        G36_saline_MI_pvalues = cat(1,G36_saline_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F6(2)_36') && strcmp(Placeness_MetaData(n).drug, "saline") && strcmp(Placeness_MetaData(n).session, 'day1') && ~isempty(G36_saline_MI_pvalues)
        G36_saline_MI_pvalues = cat(1,G36_saline_MI_pvalues,Placeness_MetaData(n).MI_p_values);        
    end
end
[G36sf,G36sx,G36slow,G36shigh] = ecdf(G36_saline_MI_pvalues,'Function','cdf','Alpha',0.05);

%% Organize data for MUT saline

% get MUT saline CDF mean
A = cat(1,G17sf,G21sf,G45sf,G53sf,G36sf);
MUT_saline_F = sort(A);

% get MUT saline CDF x-steps
B = cat(1,G17sx,G21sx,G45sx,G53sx,G36sx);
MUT_saline_X = sort(B);

% get MUT saline CDF high bound mean
C = cat(1,G17shigh,G21shigh,G45shigh,G53shigh,G36shigh);
MUT_saline_H = sort(C);

% get MUT saline CDF low bound mean
D = cat(1,G17slow,G21slow,G45slow,G53slow,G36slow);
MUT_saline_L = sort(D);

% Optional plotting
% % figure
% % plot(MUT_saline_X, MUT_saline_F, '-b', 'LineWidth', 1);
% % hold on
% % plot(MUT_saline_X, MUT_saline_H, '--k', 'LineWidth', 0.1);
% % hold on
% % plot(MUT_saline_X, MUT_saline_L, '--k', 'Linewidth', 0.1);
% % xlim([0,1])
% % ylim([0,1])
% % legend('p-MUT saline','95% confidence interval','','Location','northwest')
% % hold off

%% collect data for WT ETOM 7mg/kg
% G18
G18_Etom7_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F4_18') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G18_Etom7_MI_pvalues)
        G18_Etom7_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F4_18') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G18_Etom7_MI_pvalues)
        G18_Etom7_MI_pvalues = cat(1,G18_Etom7_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    end
end
[G18e7f,G18e7x,G18e7low,G18e7high] = ecdf(G18_Etom7_MI_pvalues,'Function','cdf','Alpha',0.05);

% G28
G28_Etom7_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_28') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G28_Etom7_MI_pvalues)
        G28_Etom7_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_28') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G28_Etom7_MI_pvalues)
        G28_Etom7_MI_pvalues = cat(1,G28_Etom7_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    end
end
[G28e7f,G28e7x,G28e7low,G28e7high] = ecdf(G28_Etom7_MI_pvalues,'Function','cdf','Alpha',0.05);

% G31
G31_Etom7_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_31') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G31_Etom7_MI_pvalues)
        G31_Etom7_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_31') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G31_Etom7_MI_pvalues)
        G31_Etom7_MI_pvalues = cat(1,G31_Etom7_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    end
end
[G31e7f,G31e7x,G31e7low,G31e7high] = ecdf(G31_Etom7_MI_pvalues,'Function','cdf','Alpha',0.05);

% G34
G34_Etom7_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_34') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G34_Etom7_MI_pvalues)
        G34_Etom7_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_34') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G34_Etom7_MI_pvalues)
        G34_Etom7_MI_pvalues = cat(1,G34_Etom7_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    end
end
[G34e7f,G34e7x,G34e7low,G34e7high] = ecdf(G34_Etom7_MI_pvalues,'Function','cdf','Alpha',0.05);

% G42
G42_e7_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F6(2)_42') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G42_e7_MI_pvalues)
        G42_e7_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F6(2)_42') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'day1') && isempty(G42_e7_MI_pvalues)
        G42_e7_MI_pvalues = Placeness_MetaData(n).MI_p_values;        
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F6(2)_42') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G42_e7_MI_pvalues)
        G42_e7_MI_pvalues = cat(1,G42_e7_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F6(2)_42') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'day1') && ~isempty(G42_e7_MI_pvalues)
        G42_e7_MI_pvalues = cat(1,G42_e7_MI_pvalues,Placeness_MetaData(n).MI_p_values);        
    end
end
[G42e7f,G42e7x,G42e7low,G42e7high] = ecdf(G42_e7_MI_pvalues,'Function','cdf','Alpha',0.05);

%% Organize data for WT Etom 7mg/kg

% get WT etom7 CDF mean
A = cat(1,G18e7f,G28e7f,G31e7f,G34e7f,G42e7f);
WT_etom7_F = sort(A);

% get WT etom7 CDF x-steps
B = cat(1,G18e7x,G28e7x,G31e7x,G34e7x,G42e7x);
WT_etom7_X = sort(B);

% get WT etom7 CDF high bound mean
C = cat(1,G18e7high,G28e7high,G31e7high,G34e7high,G42e7high);
WT_etom7_H = sort(C);

% get WT etom7 CDF low bound mean
D = cat(1,G18e7low,G28e7low,G31e7low,G34e7low,G42e7low);
WT_etom7_L = sort(D);

% Optional plotting
% % figure
% % plot(WT_etom7_X, WT_etom7_F, '-b', 'LineWidth', 1);
% % hold on
% % plot(WT_etom7_X, WT_etom7_H, '--k', 'LineWidth', 0.1);
% % hold on
% % plot(WT_etom7_X, WT_etom7_L, '--k', 'Linewidth', 0.1);
% % xlim([0,1])
% % ylim([0,1])
% % legend('p-WT Etomidate 7mg/kg','95% confidence interval','','Location','northwest')
% % hold off

%% collect data for MUT ETOM 7mg/kg
% G17
G17_Etom7_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F4_17') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G17_Etom7_MI_pvalues)
        G17_Etom7_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F4_17') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G17_Etom7_MI_pvalues)
        G17_Etom7_MI_pvalues = cat(1,G17_Etom7_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    end
end
[G17e7f,G17e7x,G17e7low,G17e7high] = ecdf(G17_Etom7_MI_pvalues,'Function','cdf','Alpha',0.05);

% G21
G21_Etom7_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_21') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G21_Etom7_MI_pvalues)
        G21_Etom7_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_21') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G21_Etom7_MI_pvalues)
        G21_Etom7_MI_pvalues = cat(1,G21_Etom7_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    end
end
[G21e7f,G21e7x,G21e7low,G21e7high] = ecdf(G21_Etom7_MI_pvalues,'Function','cdf','Alpha',0.05);

% G45
G45_Etom7_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_45') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G45_Etom7_MI_pvalues)
        G45_Etom7_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_45') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G45_Etom7_MI_pvalues)
        G45_Etom7_MI_pvalues = cat(1,G45_Etom7_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    end
end
[G45e7f,G45e7x,G45e7low,G45e7high] = ecdf(G45_Etom7_MI_pvalues,'Function','cdf','Alpha',0.05);

% G53
G53_Etom7_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_53') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G53_Etom7_MI_pvalues)
        G53_Etom7_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F5(2)_53') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G53_Etom7_MI_pvalues)
        G53_Etom7_MI_pvalues = cat(1,G53_Etom7_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    end
end
[G53e7f,G53e7x,G53e7low,G53e7high] = ecdf(G53_Etom7_MI_pvalues,'Function','cdf','Alpha',0.05);

% G36
G36_e7_MI_pvalues = [];
for n = 1:size(Placeness_MetaData,2)
    if strcmp(Placeness_MetaData(n).animalName, 'G2_F6(2)_36') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && isempty(G36_e7_MI_pvalues)
        G36_e7_MI_pvalues = Placeness_MetaData(n).MI_p_values;
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F6(2)_36') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'day1') && isempty(G36_e7_MI_pvalues)
        G36_e7_MI_pvalues = Placeness_MetaData(n).MI_p_values;        
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F6(2)_36') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'AM') && ~isempty(G36_e7_MI_pvalues)
        G36_e7_MI_pvalues = cat(1,G36_e7_MI_pvalues,Placeness_MetaData(n).MI_p_values);
    elseif strcmp(Placeness_MetaData(n).animalName, 'G2_F6(2)_36') && strcmp(Placeness_MetaData(n).drug, "etomidate 7mg/kg") && strcmp(Placeness_MetaData(n).session, 'day1') && ~isempty(G36_e7_MI_pvalues)
        G36_e7_MI_pvalues = cat(1,G36_e7_MI_pvalues,Placeness_MetaData(n).MI_p_values);        
    end
end
[G36e7f,G36e7x,G36e7low,G36e7high] = ecdf(G36_e7_MI_pvalues,'Function','cdf','Alpha',0.05);

%% Organize data for MUT Etom 7mg/kg

% get MUT etom7 CDF mean
A = cat(1,G17e7f,G21e7f,G45e7f,G53e7f,G36e7f);
MUT_etom7_F = sort(A);

% get MUT etom7 CDF x-steps
B = cat(1,G17e7x,G21e7x,G45e7x,G53e7x,G36e7x);
MUT_etom7_X = sort(B);

% get MUT etom7 CDF high bound mean
C = cat(1,G17e7high,G21e7high,G45e7high,G53e7high,G36e7high);
MUT_etom7_H = sort(C);

% get MUT etom7 CDF low bound mean
D = cat(1,G17e7low,G21e7low,G45e7low,G53e7low,G36e7low);
MUT_etom7_L = sort(D);

% Optional plotting
% % figure
% % plot(MUT_etom7_X, MUT_etom7_F, '-m', 'LineWidth', 1);
% % hold on
% % plot(MUT_etom7_X, MUT_etom7_H, '--k', 'LineWidth', 0.1);
% % hold on
% % plot(MUT_etom7_X, MUT_etom7_L, '--k', 'Linewidth', 0.1);
% % xlim([0,1])
% % ylim([0,1])
% % legend('\alpha5-i-KO ETOM 7mg/kg','95% confidence interval','','Location','northwest')
% % hold off

%% plot all data

figure
subplot(1,4,1)
plot(WT_saline_X,WT_saline_F,'Color','#1750AC','LineWidth',3);
hold on
% plot(WT_saline_X,WT_saline_L,'--k','LineWidth',1);
% hold on
% plot(WT_saline_X,WT_saline_H,'--k','LineWidth',1);
% hold on
plot(MUT_saline_X,MUT_saline_F,'Color','#F53BD6','LineWidth',3);
hold on
% plot(MUT_saline_X,MUT_saline_L,'--k','LineWidth',1);
% hold on
% plot(MUT_saline_X,MUT_saline_H,'--k','LineWidth',1);
% hold on
legend('p-WT Saline','\alpha5-i-KO Saline','Location','northwest');
xlabel('p(MI)')
ylabel('Cumulative Cell Fraction')
set(gca,'FontSize',15); 
% set(gca, 'visible', 'off')
hold off

subplot(1,4,2)
plot(WT_saline_X,WT_saline_F,'Color','#1750AC','LineWidth',3);
hold on
% plot(WT_saline_X,WT_saline_L,'--k','LineWidth',1);
% hold on
% plot(WT_saline_X,WT_saline_H,'--k','LineWidth',1);
% hold on
plot(WT_etom7_X,WT_etom7_F,'Color','#73B9EE','LineWidth',3);
hold on
% plot(WT_etom7_X,WT_etom7_L,'--k','LineWidth',1);
% hold on
% plot(WT_etom7_X,WT_etom7_H,'--k','LineWidth',1);
% hold on
legend('p-WT Saline','p-WT Etom 7mg/kg','Location','northwest');
% xlabel('MI Shuffle Test p-Values')
% ylabel('Cumulative Fraction of Cells')
set(gca,'FontSize',15); 
% set(gca, 'visible', 'off')
hold off

subplot(1,4,3)
plot(MUT_saline_X,MUT_saline_F,'Color','#F53BD6','LineWidth',3);
hold on
% plot(MUT_saline_X,MUT_saline_L,'--k','LineWidth',1);
% hold on
% plot(MUT_saline_X,MUT_saline_H,'--k','LineWidth',1);
% hold on
plot(MUT_etom7_X,MUT_etom7_F,'Color','#FA9CEA','LineWidth',3);
hold on
% plot(MUT_etom7_X,MUT_etom7_L,'--k','LineWidth',1);
% hold on
% plot(MUT_etom7_X,MUT_etom7_H,'--k','LineWidth',1);
% hold on
legend('\alpha5-i-KO Saline','\alpha5-i-KO Etom 7mg/kg','Location','northwest');
% xlabel('MI Shuffle Test p-Values')
% ylabel('Cumulative Fraction of Cells')
set(gca,'FontSize',15); 
% set(gca, 'visible', 'off')
hold off

subplot(1,4,4)
plot(WT_etom7_X,WT_etom7_F,'Color','#73B9EE','LineWidth',3);
hold on
% plot(WT_etom7_X,WT_etom7_L,'--k','LineWidth',1);
% hold on
% plot(WT_etom7_X,WT_etom7_H,'--k','LineWidth',1);
% hold on
plot(MUT_etom7_X,MUT_etom7_F,'Color','#FA9CEA','LineWidth',3);
hold on
% plot(MUT_etom7_X,MUT_etom7_L,'--k','LineWidth',1);
% hold on
% plot(MUT_etom7_X,MUT_etom7_H,'--k','LineWidth',1);
% hold on
legend('p-WT Etom 7mg/kg','\alpha5-i-KO Etom 7mg/kg','Location','northwest');
% xlabel('MI Shuffle Test p-Values')
% ylabel('Cumulative Fraction of Cells')
set(gca,'FontSize',15); 
% set(gca, 'visible', 'off')
hold off

end